Filter hook 'edit_user_{$field}'

in WP Core File wp-includes/user.php at line 1903

View Source

edit_user_{$field}

Filter Hook
Description
Filters a user field value in the 'edit' context. The dynamic portion of the hook name, `$field`, refers to the prefixed user field being filtered, such as 'user_login', 'user_email', 'first_name', etc.

Hook Information

File Location wp-includes/user.php View on GitHub
Hook Type Filter
Line Number 1903

Hook Parameters

Type Name Description
mixed $value Value of the prefixed user field.
int $user_id User ID.

Usage Examples

Basic Usage
<?php
// Hook into edit_user_{$field}
add_filter('edit_user_{$field}', 'my_custom_filter', 10, 2);

function my_custom_filter($value, $user_id) {
    // Your custom filtering logic here
    return $value;
}

Source Code Context

wp-includes/user.php:1903 - How this hook is used in WordPress core
<?php
1898  			 * @since 2.9.0
1899  			 *
1900  			 * @param mixed $value   Value of the prefixed user field.
1901  			 * @param int   $user_id User ID.
1902  			 */
1903  			$value = apply_filters( "edit_user_{$field}", $value, $user_id );
1904  		}
1905  
1906  		if ( 'description' === $field ) {
1907  			$value = esc_html( $value ); // textarea_escaped?
1908  		} else {

PHP Documentation

<?php
/**
			 * Filters a user field value in the 'edit' context.
			 *
			 * The dynamic portion of the hook name, `$field`, refers to the prefixed user
			 * field being filtered, such as 'user_login', 'user_email', 'first_name', etc.
			 *
			 * @since 2.9.0
			 *
			 * @param mixed $value   Value of the prefixed user field.
			 * @param int   $user_id User ID.
			 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/user.php
Related Hooks

Related hooks will be displayed here in future updates.